{% extends "community/base.html" %}

{% block head %}
{% endblock %}

{% block body %}

<!--顶部导航栏-->
<!--顶部导航栏-->
<div class="topblock">
<a href="{{ url_for('community.index')}}">
<img class="home" src="../static/layui/images/community/home.png"></a>
<div class="search">
     <form method="GET" action="{{ url_for('community.search') }}">
    <input type="text" placeholder="搜索您感兴趣的内容" class="layui-input" name="key">
      <div class="search_btn">
        <button class="layui-btn layui-btn-primary">搜索</button>
      </div>
     </form>
</div>
<div class="tabbar">
<ul class="layui-nav layui-bg-green" lay-bar="disabled">
        <li class="layui-nav-item"><a href="{{ url_for('community.category',post_type=1) }}" style="color: black;font-size: 16px">读者社区</a></li>
        <li class="layui-nav-item"><a href="{{ url_for('community.category',post_type=2) }}" style="color: black;font-size: 16px">图书专区</a></li>
        <li class="layui-nav-item"><a href="{{ url_for('community.category',post_type=4) }}" style="color: black;font-size: 16px">打听求助</a></li>
        <li class="layui-nav-item"><a href="{{ url_for('community.category',post_type=3) }}" style="color: black;font-size: 16px">资源分享</a></li>
</ul>
</div>
    <div class="topright">
     <img class="icon" src="../static/layui/images/community/account.png">
     <img class="icon" src="../static/layui/images/community/set.png">
     <img class="icon" src="../static/layui/images/community/help.png">
    <button type="button" class="layui-btn layui-btn-warm layui-btn-radius">发布</button>
    </div>
</div>

<div class="block2_s">
    <h1>{{ title }}</h1>
    <div class="post_block">
        <ul>
{% for post in posts %}
    <li><a href="{{ url_for('community.post_detail',post_id=post.id) }}">
        <div class="post_small">
          <div class="post_top">
              {{ post.author_id }}{{post.title}}
          </div>
          <div class="post_bottom">
              <img class="post_ico" src="../static/layui/images/community/like.png"><span class="layui-badge">{{ post.likes }}</span></img>
              <img class="post_ico" src="../static/layui/images/community/comment.png"></img>
          </div>
        </div>
    </a>
    </li>
            {% endfor %}
        </ul>
  </div>
</div>

<div class="side_block">
    <h1>公告</h1>
    <ul >
{% for announce in announces %}
    <li class="announce"><a href="{{ url_for('community.announce_detail',announce_id=announce.id) }}">
     <div class="announce_inner">
         <div class="announce_title">{{announce.title}}</div>
         <span class="announce_time">{{ announce.create_time }}</span>
     </div>
    </a></li>
{% endfor %}
    </ul>
</div>



<div class="banner">
<div class="layui-carousel" id="ID-carousel-demo-image">
  <div carousel-item>
    <div><img src="../static/layui/images/community/banner1.png"></div>
    <div><img src="../static/layui/images/community/banner2.png"></div>
    <div><img src="../static/layui/images/community/banner3.png"></div>
  </div>
</div>
</div>


<script src="//unpkg.com/layui@2.9.9/dist/layui.js"></script>
<script>



</script>
{% endblock %}